package com.xdb.sqlparser.dialect.mysql.ast.statement;

import com.xdb.sqlparser.ast.statement.SQLSelectGroupByClause;
import com.xdb.sqlparser.dialect.mysql.visitor.MySqlASTVisitor;
import com.xdb.sqlparser.visitor.SQLAstVisitor;

public class MySqlSelectGroupBy extends SQLSelectGroupByClause {

	private boolean rollUp = false;

	public boolean isRollUp() {
		return rollUp;
	}

	public void setRollUp(boolean rollUp) {
		this.rollUp = rollUp;
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		if (visitor instanceof MySqlASTVisitor) {
			accept0((MySqlASTVisitor) visitor);
		} else {
			if (visitor.visit(this)) {
				acceptChild(visitor, this.getItems());
				acceptChild(visitor, this.getHaving());
			}

			visitor.endVisit(this);
		}
	}

	protected void accept0(MySqlASTVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, this.getItems());
			acceptChild(visitor, this.getHaving());
		}

		visitor.endVisit(this);
	}
}
